import { BasicPageParams } from '../model/baseModel';
import { defHttp } from '/@/utils/http/axios';

enum Api {
  USER_PREFIX = '/admin',
  Users = '/users',
  User = '/user',
  password = '/modify',
}

export const updateInfo = (params: any) =>
  defHttp.put(
    {
      url: Api.USER_PREFIX + Api.USER_PREFIX,
      params,
    },
    {
      successMessageMode: 'message',
    },
  );

export const modifyPassword = (params: any) =>
  defHttp.put(
    {
      url: Api.USER_PREFIX + Api.password,
      params,
    },
    {
      successMessageMode: 'message',
    },
  );

export const disableUserApi = (params: any) =>
  defHttp.put(
    {
      url: Api.USER_PREFIX + Api.User,
      params,
    },
    {
      successMessageMode: 'message',
    },
  );
export const getUsersApi = (params: BasicPageParams) =>
  defHttp.get({
    url: Api.USER_PREFIX + Api.Users,
    params,
  });
